﻿
//  Copyright (c) Microsoft Corporation.  All Rights Reserved.

using System;
using System.ServiceModel;

namespace Microsoft.Samples.TcpActivation
{
	// Define a service contract.
	[ServiceContract(Namespace = "http://Microsoft.Samples.TcpActivation")]
	public interface ICalculator
	{
		[OperationContract]
		double Add(double n1, double n2);
		[OperationContract]
		double Subtract(double n1, double n2);
		[OperationContract]
		double Multiply(double n1, double n2);
		[OperationContract]
		double Divide(double n1, double n2);
	}

	// Service class which implements the service contract.
	public class CalculatorService : ICalculator
	{
		public double Add(double n1, double n2)
		{
			return n1 + n2;
		}

		public double Subtract(double n1, double n2)
		{
			return n1 - n2;
		}

		public double Multiply(double n1, double n2)
		{
			return n1 * n2;
		}

		public double Divide(double n1, double n2)
		{
			return n1 / n2;
		}
	}

	
}
